<template>
  <div>
      <!-- 上半部分 -->
      <router-view/>
      <!-- 底部选项卡 -->
      <van-tabbar v-model="active" route fixed :border="false" active-color="#ffd101">
          <van-tabbar-item name="index" to="/home/index" icon="wap-home-o">首页</van-tabbar-item>
          <van-tabbar-item name="shop" to="/home/shop">
            电商
            <img v-if="active=='shop'" src="@/assets/img/main_1.png" slot="icon">
            <img v-else src="@/assets/img/main_0.png" slot="icon">
          </van-tabbar-item>
          <van-tabbar-item name="message" to="/home/message" icon="chat-o" badge="99+">消息</van-tabbar-item>
          <van-tabbar-item name="shopcar" to="/home/shopcar" icon="shopping-cart-o" badge="9">购物车</van-tabbar-item>
          <van-tabbar-item name="me" to="/home/me" icon="contact">我的</van-tabbar-item>
      </van-tabbar>
  </div>
</template>

<script>
  export default {
      data() {
        return { 
          active: this.$route.path.split('/').pop()
        }
      }
  }
</script>

<style lang="scss">
$active-color:#ffd101;
.van-info {
  background-color: #ff5228 !important;
}
</style>